<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑批发客户档案</title>
    <link rel="stylesheet" href="__PEAR__/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
            
				 <div class="layui-form-item">
				    <label class="layui-form-label">批发商编码</label>
				    <div class="layui-input-inline">
				      <input type="text" name="own_code" value="{$one['own_code']}" maxlength="40" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				    
				    <label class="layui-form-label">公司名称</label>
				    <div class="layui-input-inline">
				      <input type="text" name="company" value="{$one['company']}" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				   <div class="layui-form-item">
				    <label class="layui-form-label">联系人</label>
				    <div class="layui-input-inline">
				      <input type="text" name="linkname" value="{$one['linkname']}" maxlength="40" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				    
				    <label class="layui-form-label">手机号码</label>
				    <div class="layui-input-inline">
				      <input type="text" name="mobile" value="{$one['mobile']}" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">电话</label>
				    <div class="layui-input-inline">
				      <input type="text" name="phone" value="{$one['phone']}" maxlength="40" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				    
				    <label class="layui-form-label">传真</label>
				    <div class="layui-input-inline">
				      <input type="text" name="fax" value="{$one['fax']}" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">地址</label>
				    <div class="layui-input-inline">
				      <input type="text" name="address" value="{$one['address']}" maxlength="40" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				    
				    <label class="layui-form-label">邮编</label>
				    <div class="layui-input-inline">
				      <input type="text" name="zip_code" value="{$one['zip_code']}" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				 <div class="layui-form-item">
				 
				  <label class="layui-form-label">电子邮件</label>
				    <div class="layui-input-inline">
				      <input type="text" name="email" value="{$one['email']}" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				    
				    <label class="layui-form-label">业务员</label>
				    <div class="layui-input-inline">
				      <select name="saleman" id='saleman'>
				             <option value="">请选择业务员</option>
				             {volist name="operList" id="vo"}
				             <option value="{$vo['oper_id']}" {if condition="$one['saleman'] eq $vo['oper_id']"}selected="selected"{/if}>{$vo.oper_name}</option>
				             {/volist}
				         </select>
				    </div>
				    
				   
				  </div>
				  
				   <div class="layui-form-item">
				    <label class="layui-form-label">所属区域</label>
				    <div class="layui-input-inline">
				        <select name="area_no" id='area_no'>
				                <option value="">请选择区域</option>
				                {volist name="areaList" id="vo"}
				                <option value="{$vo.code_id}" {if condition="$one['area_no'] eq $vo['code_id']"}selected="selected"{/if}>{$vo.code_name}</option>
				                {/volist}
				            </select>
				    </div>
				     <label class="layui-form-label">冻结账款</label>
				    <div class="layui-input-inline">
				        <select name="credit_status" id='credit_status'>
				               <option value="0" {if condition="$one['credit_status'] neq 1"}selected="selected"{/if}>正常</option>
				                <option value="1" {if condition="$one['credit_status'] eq 1"}selected="selected"{/if}>冻结</option>
				            </select>
				    </div>
				  </div>
				  
				     <div class="layui-form-item">
				    <label class="layui-form-label">企业类型</label>
				    <div class="layui-input-inline">
				        <select name="enterprise_type" id='enterprise_type'>
				                <option value="">请选择</option>
				                {volist name="entType" id="vo"}
				                <option value="{$vo.code_id}" {if condition="$one['enterprise_type'] eq $vo['code_id']"}selected="selected"{/if}>{$vo.code_name}</option>
				                {/volist}
				            </select>
				    </div>
				     <label class="layui-form-label">冻结业务</label>
				    <div class="layui-input-inline">
				        <select name="business_statusxf" id='business_statusxf'>
				               <option value="0" {if condition="$one['business_statusxf'] neq 1"}selected="selected"{/if}>正常</option>
				                <option value="1" {if condition="$one['business_statusxf'] eq 1"}selected="selected"{/if}>冻结</option>
				            </select>
				    </div>
				  </div>
				  
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">结算方式</label>
				    <div class="layui-input-inline">
				        <select id='balance_way' name='balance_way'>
				        		{volist name="balanceWay" id="vo"}
				                 <option value="{$vo['code_id']}" {if condition="$one['balance_way'] eq $vo['code_id']"}selected="selected"{/if}>{$vo['code_name']}</option>
				              	{/volist}
				            </select>
				    </div>
				    
				    <label class="layui-form-label">开户行</label>
				    <div class="layui-input-inline">
				      <input type="text" name="bank_name" value="{$one['bank_name']}" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">默认价格</label>
				    <div class="layui-input-inline">
				        <select id='type_no' name='type_no'>
				        		{volist name="typeList" id="vo"}
				                 <option value="{$vo['type_no']}" {if condition="$one['type_no'] eq $vo['type_no']"}selected="selected"{/if}>{$vo['type_name']}</option>
				              	{/volist}
				            </select>
				    </div>
				    
				    <label class="layui-form-label">银行账户</label>
				    <div class="layui-input-inline">
				      <input type="text" name="bank_id" value="{$one['bank_id']}" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">结账周期</label>
				    <div class="layui-input-inline">
				      <input value="30" name="check_out_day" readonly='readonly' class="layui-input"/>
				    </div>
				    
				    <label class="layui-form-label">营业执照</label>
				    <div class="layui-input-inline">
				      <input type="text"  value="{$one['license_no']}" name="license_no" value="license_no" class="layui-input"/>
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">月结账日期</label>
				    <div class="layui-input-inline">
				      <input value="30" name="check_out_date" readonly='readonly' class="layui-input"/>
				    </div>
				    
				    <label class="layui-form-label">注册类型</label>
				    <div class="layui-input-inline">
				      <input type="text" value="{$one['register_type']}" name="register_type" value="register_type" class="layui-input"/>
				    </div>
				  </div>
				  
				   <div class="layui-form-item">
				    <label class="layui-form-label">备注</label>
				    <div class="layui-input-inline">
				      <input value="{$one['memo']}" name="memo"  class="layui-input"/>
				    </div>
				    
				    <label class="layui-form-label">税务登记号</label>
				    <div class="layui-input-inline">
				      <input type="text" name="tax_no" value="{$one['tax_no']}" class="layui-input"/>
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">信誉额度</label>
				    <div class="layui-input-inline">
				      <input value="{$one['credibility']}" name="credibility"  class="layui-input"/>
				    </div>
				    
				    <label class="layui-form-label">所属门店</label>
				    <div class="layui-input-inline">
				        <select name='branch_no'>
				        		{volist name="branchs" id="vo"}
				                 <option value="{$vo['branch_no']}" {if condition="$one['branch_no'] eq $vo['branch_no']"}selected="selected"{/if}>{$vo['branch_name']}</option>
				              	{/volist}
				            </select>
				    </div>
				  </div>
				  
			     <div class="layui-form-item">
				    <label class="layui-form-label">是否审核</label>
				    <div class="layui-input-inline">
				      <input type="checkbox" {if condition="$one['status'] eq 1"}checked="checked"{/if} name="status" value='1' title="是">
				    </div>
				 </div>
				
        		<input name="clients_no" type="hidden" value="{$one['clients_no']}"/>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="sup-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="__STATIC__/lib/layui/layui.js"></script>
<script src="__PEAR__/component/pear/pear.js"></script>
<script>
layui.use(['form','jquery'],function(){
    let form = layui.form;
    let $ = layui.jquery;
    var path="/{$MODULE_NAME}/Wholesale/index";
	var _url="/save";

    form.on('submit(sup-save)', function(data){
    	
        $.ajax({
            url:path+_url,
            data:JSON.stringify(data.field),
            dataType:'json',
            contentType:'application/json',
            type:'post',
            success:function(result){
                if(result.code){
                    layer.msg(result.msg,{icon:1,time:1000},function(){
                        parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                        parent.layui.table.reload("wslist-table");
                    });
                }else{
                    layer.msg(result.msg,{icon:2,time:1000});
                }
            }
        })
        return false;
    });
})
</script>
<script>
</script>
</body>
</html>